
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>四、面向对象 · 计算机笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="海拉尔的三角">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro-fixed/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-ancre-navigation/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-insert-logo-link-website/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-auto-scroll-table/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex-pro/katex.min.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-terminull-light/terminull.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="memory_withNum.html" />
    
    
    <link rel="prev" href="point_reference_withNum.html" />
    

    
        <link rel="shortcut icon" href="image/ico.png" type="image/x-icon">
    
    
    
    
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="image/ico.png">
    
    
        
    
    
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://github.com/spite-triangle" target="_blank" class="custom-link">Github</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../cpp.html">
            
                <a href="../cpp.html">
            
                    
                    C/C++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="foundation_withNum.html">
            
                <a href="foundation_withNum.html">
            
                    
                    一、基础概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="keyword_withNum.html">
            
                <a href="keyword_withNum.html">
            
                    
                    二、关键字
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="point_reference_withNum.html">
            
                <a href="point_reference_withNum.html">
            
                    
                    三、指针与引用
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.1.4" data-path="oop_withNum.html">
            
                <a href="oop_withNum.html">
            
                    
                    四、面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="memory_withNum.html">
            
                <a href="memory_withNum.html">
            
                    
                    五、内存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="process_withNum.html">
            
                <a href="process_withNum.html">
            
                    
                    六、进程与线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="locks_withNum.html">
            
                <a href="locks_withNum.html">
            
                    
                    七、锁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.8" data-path="stl_withNum.html">
            
                <a href="stl_withNum.html">
            
                    
                    八、STL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.9" data-path="dataStruction_withNum.html">
            
                <a href="dataStruction_withNum.html">
            
                    
                    九、数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.10" data-path="array_list_withNum.html">
            
                <a href="array_list_withNum.html">
            
                    
                    十、数组链表操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.11" data-path="find_withNum.html">
            
                <a href="find_withNum.html">
            
                    
                    十一、目标查找
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.12" data-path="tree_withNum.html">
            
                <a href="tree_withNum.html">
            
                    
                    十二、树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.13" data-path="binaryTree_withNum.html">
            
                <a href="binaryTree_withNum.html">
            
                    
                    十三、二叉树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.14" data-path="dynamicProgram_withNum.html">
            
                <a href="dynamicProgram_withNum.html">
            
                    
                    十四、动态规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.15" data-path="backtracking_withNum.html">
            
                <a href="backtracking_withNum.html">
            
                    
                    十五、回溯算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.16" data-path="monotoneStack_withNum.html">
            
                <a href="monotoneStack_withNum.html">
            
                    
                    十六、单调栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.17" data-path="toollib_withNum.html">
            
                <a href="toollib_withNum.html">
            
                    
                    附录 工具库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../../MySQL/mysql.html">
            
                <a href="../../MySQL/mysql.html">
            
                    
                    MySQL
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="../../MySQL/chapter/introduction_withNum.html">
            
                <a href="../../MySQL/chapter/introduction_withNum.html">
            
                    
                    一、简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="../../MySQL/chapter/foundation_withNum.html">
            
                <a href="../../MySQL/chapter/foundation_withNum.html">
            
                    
                    二、控制台操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="../../MySQL/chapter/operatorDB_withNum.html">
            
                <a href="../../MySQL/chapter/operatorDB_withNum.html">
            
                    
                    三、数据库、表操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.4" data-path="../../MySQL/chapter/operatorData_withNum.html">
            
                <a href="../../MySQL/chapter/operatorData_withNum.html">
            
                    
                    四、数据操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.5" data-path="../../MySQL/chapter/transaction_withNum.html">
            
                <a href="../../MySQL/chapter/transaction_withNum.html">
            
                    
                    五、事务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.6" data-path="../../MySQL/chapter/index_withNum.html">
            
                <a href="../../MySQL/chapter/index_withNum.html">
            
                    
                    六、索引
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.7" data-path="../../MySQL/chapter/authority_withNum.html">
            
                <a href="../../MySQL/chapter/authority_withNum.html">
            
                    
                    七、权限管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.8" data-path="../../MySQL/chapter/backup_withNum.html">
            
                <a href="../../MySQL/chapter/backup_withNum.html">
            
                    
                    八、备份
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../../linux/linux.html">
            
                <a href="../../linux/linux.html">
            
                    
                    Linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1.1" data-path="../../linux/chapter/foundation_withNum.html">
            
                <a href="../../linux/chapter/foundation_withNum.html">
            
                    
                    一、原理知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.1.2" data-path="../../linux/chapter/command_withNum.html">
            
                <a href="../../linux/chapter/command_withNum.html">
            
                    
                    二、指令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../../tcp_udp/tcp_upd.html">
            
                <a href="../../tcp_udp/tcp_upd.html">
            
                    
                    网络
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="../../tcp_udp/chapter/foundation_withNum.html">
            
                <a href="../../tcp_udp/chapter/foundation_withNum.html">
            
                    
                    一、网络通讯基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.1.2" data-path="../../tcp_udp/chapter/tcp_udp_withNum.html">
            
                <a href="../../tcp_udp/chapter/tcp_udp_withNum.html">
            
                    
                    二、tcp/udp
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >四、面向对象</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><span class="title-icon "></span><a href="#&#x9762;&#x5411;&#x5BF9;&#x8C61;"><b></b>&#x9762;&#x5411;&#x5BF9;&#x8C61;</a></li><li><span class="title-icon "></span><a href="#1-&#x91CD;&#x8F7D;&#xFF0C;&#x91CD;&#x5199;&#xFF0C;&#x91CD;&#x5B9A;&#x4E49;"><b></b>1. &#x91CD;&#x8F7D;&#xFF0C;&#x91CD;&#x5199;&#xFF0C;&#x91CD;&#x5B9A;&#x4E49;</a></li><li><span class="title-icon "></span><a href="#2-&#x865A;&#x51FD;&#x6570;"><b></b>2. &#x865A;&#x51FD;&#x6570;</a></li><li><span class="title-icon "></span><a href="#3-&#x7EE7;&#x627F;"><b></b>3. &#x7EE7;&#x627F;</a></li><ul><li><span class="title-icon "></span><a href="#31-&#x7EE7;&#x627F;&#x5185;&#x5BB9;"><b></b>3.1. &#x7EE7;&#x627F;&#x5185;&#x5BB9;</a></li><li><span class="title-icon "></span><a href="#32-&#x5B50;&#x5BF9;&#x8C61;&#x7684;&#x4E00;&#x751F;"><b></b>3.2. &#x5B50;&#x5BF9;&#x8C61;&#x7684;&#x4E00;&#x751F;</a></li><li><span class="title-icon "></span><a href="#33-&#x62D2;&#x7EDD;&#x7EE7;&#x627F;"><b></b>3.3. &#x62D2;&#x7EDD;&#x7EE7;&#x627F;</a></li></ul><li><span class="title-icon "></span><a href="#4-&#x91CD;&#x8F7D;&#x591A;&#x6001;"><b></b>4. &#x91CD;&#x8F7D;/&#x591A;&#x6001;</a></li><li><span class="title-icon "></span><a href="#5-&#x6784;&#x9020;&#x6790;&#x6784;&#x51FD;&#x6570;"><b></b>5. &#x6784;&#x9020;/&#x6790;&#x6784;&#x51FD;&#x6570;</a></li><ul><li><span class="title-icon "></span><a href="#51-&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E3A;&#x5565;&#x4E0D;&#x80FD;&#x4E3A;&#x865A;&#x51FD;&#x6570;"><b></b>5.1. &#x6784;&#x9020;&#x51FD;&#x6570;&#x4E3A;&#x5565;&#x4E0D;&#x80FD;&#x4E3A;&#x865A;&#x51FD;&#x6570;</a></li></ul><li><span class="title-icon "></span><a href="#6-&#x9759;&#x7ED1;&#x5B9A;&#x4E0E;&#x52A8;&#x7ED1;&#x5B9A;"><b></b>6. &#x9759;&#x7ED1;&#x5B9A;&#x4E0E;&#x52A8;&#x7ED1;&#x5B9A;</a></li><li><span class="title-icon "></span><a href="#7-&#x6784;&#x9020;&#x51FD;&#x6570;"><b></b>7. &#x6784;&#x9020;&#x51FD;&#x6570;</a></li><li><span class="title-icon "></span><a href="#8-&#x52A8;&#x591A;&#x6001;&#x4E0E;&#x9759;&#x591A;&#x6001;"><b></b>8. &#x52A8;&#x591A;&#x6001;&#x4E0E;&#x9759;&#x591A;&#x6001;</a></li><li><span class="title-icon "></span><a href="#9-&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x4E0E;&#x8D4B;&#x503C;"><b></b>9. &#x62F7;&#x8D1D;&#x6784;&#x9020;&#x4E0E;&#x8D4B;&#x503C;</a></li></ul></div><a href="#&#x9762;&#x5411;&#x5BF9;&#x8C61;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 style="font-size:60px;text-align:center;" id="&#x9762;&#x5411;&#x5BF9;&#x8C61;"><a name="&#x9762;&#x5411;&#x5BF9;&#x8C61;" class="anchor-navigation-ex-anchor" href="#&#x9762;&#x5411;&#x5BF9;&#x8C61;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9762;&#x5411;&#x5BF9;&#x8C61;</h1>

<h1 id="1-&#x91CD;&#x8F7D;&#xFF0C;&#x91CD;&#x5199;&#xFF0C;&#x91CD;&#x5B9A;&#x4E49;"><a name="1-&#x91CD;&#x8F7D;&#xFF0C;&#x91CD;&#x5199;&#xFF0C;&#x91CD;&#x5B9A;&#x4E49;" class="anchor-navigation-ex-anchor" href="#1-&#x91CD;&#x8F7D;&#xFF0C;&#x91CD;&#x5199;&#xFF0C;&#x91CD;&#x5B9A;&#x4E49;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x91CD;&#x8F7D;&#xFF0C;&#x91CD;&#x5199;&#xFF0C;&#x91CD;&#x5B9A;&#x4E49;</h1>
<ul>
<li>&#x91CD;&#x8F7D; overload: <font color="#f44336">&#x540C;&#x4E00;&#x4E2A;&#x7C7B;&#x4E2D;</font>&#x3001;&#x51FD;&#x6570;&#x540D;&#x5B57;&#x76F8;&#x540C;&#x3001;&#x4F20;&#x53C2;&#x7C7B;&#x578B;&#x4E0E;&#x6570;&#x76EE;&#x4E0D;&#x540C;&#x3002;</li>
<li>&#x8986;&#x76D6; override: &#x5B9E;&#x73B0;&#x7236;&#x7C7B;virtual&#x4FEE;&#x9970;&#x51FD;&#x6570;&#xFF0C;&#x51FD;&#x6570;&#x5B9A;&#x4E49;&#x5B8C;&#x5168;&#x4E00;&#x6837;&#x3002;<font color="#f44336">&#x8986;&#x76D6;&#x4E86;&#x7236;&#x7C7B;&#x7684;&#x865A;&#x51FD;&#x6570;&#x3002;</font></li>
<li>&#x91CD;&#x5199; overwrite: &#x91CD;&#x5B9A;&#x4E49;&#x7236;&#x7C7B;&#x51FD;&#x6570;&#xFF0C;&#x4F1A;&#x5C4F;&#x853D;&#x7236;&#x7C7B;&#x6240;&#x6709;&#x540C;&#x540D;&#x51FD;&#x6570;&#x3002;</li>
</ul>
<blockquote>
<p>[!note|style:flat]
<strong>&#x51FD;&#x6570;&#x540D;&#x76F8;&#x540C;&#x5C31;&#x4F1A;&#x5C4F;&#x853D;&#x7236;&#x7C7B;&#x540C;&#x540D;&#x51FD;&#x6570;</strong></p>
<p><strong>&#x6CE8;</strong> :
&#x7528;&#x6237;&#x80FD;&#x5B9A;&#x4E49;&#x81EA;&#x5DF1;&#x7684;C&#x8BED;&#x8A00;&#x5E93;&#x51FD;&#x6570;&#xFF0C;&#x8FDE;&#x63A5;&#x5668;&#x5728;&#x8FDE;&#x63A5;&#x65F6;&#x81EA;&#x52A8;&#x4F7F;&#x7528;&#x8FD9;&#x4E9B;&#x65B0;&#x7684;&#x529F;&#x80FD;&#x51FD;&#x6570;&#x3002;&#x8FD9;&#x4E2A;&#x8FC7;&#x7A0B;&#x53EB;&#x505A;<strong>&#x91CD;&#x5B9A;&#x5411;C&#x8BED;&#x8A00;&#x5E93;&#x51FD;&#x6570;</strong>&#x3002;</p>
</blockquote>
<h1 id="2-&#x865A;&#x51FD;&#x6570;"><a name="2-&#x865A;&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#2-&#x865A;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x865A;&#x51FD;&#x6570;</h1>
<ul>
<li><strong>&#x865A;&#x51FD;&#x6570;&#x5B9E;&#x73B0;</strong><ul>
<li>&#x5E26;&#x6709;&#x865A;&#x51FD;&#x6570;&#x7684;&#x7C7B;&#x90FD;&#x4F1A;&#x6301;&#x6709;&#x4E00;&#x4E2A;&#x865A;&#x51FD;&#x6570;&#x8868;</li>
<li>&#x7EE7;&#x627F;&#x5E26;&#x6709;&#x865A;&#x51FD;&#x6570;&#x7236;&#x7C7B;&#x7684;&#x5B50;&#x7C7B;&#xFF0C;&#x4F1A;&#x590D;&#x5236;&#x4E00;&#x4EFD;&#x7236;&#x7C7B;&#x865A;&#x51FD;&#x6570;&#x8868;&#xFF0C;&#x5E76;&#x6839;&#x636E;&#x81EA;&#x8EAB;&#x5B9E;&#x73B0;&#x60C5;&#x51B5;&#x4FEE;&#x6539;&#x865A;&#x51FD;&#x6570;&#x8868;</li>
<li>&#x7EE7;&#x627F;&#x591A;&#x4E2A;&#x6709;&#x865A;&#x51FD;&#x6570;&#x8868;&#x7684;&#x5B50;&#x7C7B;&#xFF0C;&#x4F1A;&#x7EF4;&#x62A4;&#x6240;&#x6709;&#x7684;&#x7236;&#x7C7B;&#x865A;&#x51FD;&#x6570;&#x8868;</li>
<li>&#x5B9E;&#x4F8B;&#x5316;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x4F1A;&#x6301;&#x6709;&#x4E00;&#x4E2A;&#x6307;&#x5411;&#x865A;&#x51FD;&#x6570;&#x8868;&#x7684;&#x6307;&#x9488;<code>vptr</code></li>
<li><strong><code>vptr</code>&#x5728;&#x6784;&#x9020;&#x5668;&#x88AB;&#x8C03;&#x7528;&#x65F6;&#xFF0C;&#x521D;&#x59CB;&#x5316;&#x8D4B;&#x503C;</strong></li>
</ul>
</li>
<li><strong>&#x865A;&#x51FD;&#x6570;/&#x7EAF;&#x865A;&#x51FD;&#x6570;</strong> <font color="#f44336">&#x5B50;&#x7C7B;&#x5B9E;&#x73B0;&#x540E;&#x7B97;overwrite</font><ul>
<li>&#x865A;&#x51FD;&#x6570;: virtual&#x4FEE;&#x9970;&#xFF0C;&#x7236;&#x7C7B;&#x5B9E;&#x73B0;</li>
<li>&#x7EAF;&#x865A;&#x51FD;&#x6570;: virtual&#x4FEE;&#x9970;&#xFF0C;&#x7236;&#x7C7B;&#x4E0D;&#x5B9E;&#x73B0;&#xFF0C;&#x540E;&#x9762;&#x53EF;&#x6709; = 0&#xFF0C;<font color="#f44336">&#x7EAF;&#x865A;&#x51FD;&#x6570;&#x7684;&#x7C7B;&#x4E3A;&#x62BD;&#x8C61;&#x7C7B;&#x3002;</font></li>
</ul>
</li>
</ul>
<blockquote>
<p>[!note|style:flat]</p>
<font color="#f44336">&#x865A;&#x51FD;&#x6570;&#x662F;&#x52A8;&#x7ED1;&#x5B9A;&#xFF0C;&#x8FD0;&#x884C;&#x65F6;&#x786E;&#x5B9A;&#x3002;</font>

</blockquote>
<pre class="language-"><code class="lang-cpp"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;stdio.h&gt;</span></span>

<span class="token keyword">class</span> <span class="token class-name">Parent</span><span class="token punctuation">{</span>
<span class="token keyword">public</span><span class="token operator">:</span>
    <span class="token function">Parent</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        <span class="token function">fcn</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">virtual</span> <span class="token keyword">void</span> <span class="token function">fcn</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">&quot;parent\n&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">class</span> <span class="token class-name">Son</span> <span class="token operator">:</span> <span class="token base-clause"><span class="token keyword">public</span> <span class="token class-name">Parent</span></span><span class="token punctuation">{</span>
<span class="token keyword">public</span><span class="token operator">:</span>
    <span class="token function">Son</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        <span class="token function">fcn</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token keyword">virtual</span> <span class="token keyword">void</span> <span class="token function">fcn</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">&quot;son \n&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token keyword">const</span> <span class="token operator">*</span>argv<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    Son son<span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p></p><div class="terminull">
    <div class="terminullMenu">
      <div class="terminullButtons terminullClose"></div>
      <div class="terminullButtons terminullMinimize"></div>
      <div class="terminullButtons terminullZoom"></div>
    </div>
    <div class="terminullScreen">
        
          <span class="terminullDirectory">triangle@LEARN_FUCK:~</span>$ 
          <span class="terminullCommand">make</span>
          
          <i class="fa fa-clone t-copy terminullCopyBtn" onclick="copyCommandTerminull(`make`)"></i>
          <span class="terminullOutput">parent
son</span>
        
    </div>
</div><p></p>
<blockquote>
<p>[!note|style:flat]</p>
<ul>
<li><strong>&#x6784;&#x9020;&#x987A;&#x5E8F;&#x662F;&#x5148;&#x7236;&#x7C7B;&#xFF0C;&#x518D;&#x5B50;&#x7C7B;&#xFF1B;&#x5728;&#x6784;&#x9020;&#x7236;&#x7C7B;&#x65F6;&#xFF0C;<code>vptr</code>&#x8FD8;&#x662F;&#x6307;&#x5411;&#x7236;&#x7C7B;&#x7684;&#x865A;&#x51FD;&#x6570;&#x8868;&#xFF0C;&#x5728;&#x6784;&#x9020;&#x5B50;&#x7C7B;&#x65F6;&#xFF0C;&#x624D;&#x5C06;<code>vptr</code>&#x4FEE;&#x6539;&#x4E3A;&#x5B50;&#x7C7B;&#x7684;&#x865A;&#x51FD;&#x6570;&#x8868;&#x3002;</strong></li>
</ul>
</blockquote>
<h1 id="3-&#x7EE7;&#x627F;"><a name="3-&#x7EE7;&#x627F;" class="anchor-navigation-ex-anchor" href="#3-&#x7EE7;&#x627F;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x7EE7;&#x627F;</h1>
<p><strong>&#x5F53;&#x79C1;&#x6709;&#x7EE7;&#x627F;&#x548C;&#x4FDD;&#x62A4;&#x7EE7;&#x627F;&#x65F6;&#xFF0C;&#x7236;&#x7C7B;&#x6307;&#x9488;(&#x5F15;&#x7528;)&#x65E0;&#x6CD5;&#x6307;&#x5411;&#x5B50;&#x7C7B;&#x3002;&#x9ED8;&#x8BA4;&#x4E3A;&#x79C1;&#x6709;&#x7EE7;&#x627F;&#x3002;&#x9632;&#x6B62;&#x591A;&#x91CD;&#x7EE7;&#x627F;&#xFF0C;&#x51FA;&#x73B0;&#x5C5E;&#x6027;&#x591A;&#x6B21;&#x5B9A;&#x4E49;&#xFF0C;&#x7EE7;&#x627F;&#x65F6;&#xFF0C;&#x8FD8;&#x8981;&#x4F7F;&#x7528; virtual &#x8FDB;&#x884C;&#x4FEE;&#x9970;&#x3002;</strong></p>
<h2 id="31-&#x7EE7;&#x627F;&#x5185;&#x5BB9;"><a name="31-&#x7EE7;&#x627F;&#x5185;&#x5BB9;" class="anchor-navigation-ex-anchor" href="#31-&#x7EE7;&#x627F;&#x5185;&#x5BB9;"><i class="fa fa-link" aria-hidden="true"></i></a>3.1. &#x7EE7;&#x627F;&#x5185;&#x5BB9;</h2>
<blockquote>
<p>[!tip]
<strong>&#x5B50;&#x7C7B;&#x4F1A;&#x7EE7;&#x627F;&#x7684;&#x57FA;&#x7C7B;&#x7684;&#x6570;&#x636E;</strong></p>
<ul>
<li>&#x57FA;&#x7C7B;&#x4E2D;&#x7684;&#x6BCF;&#x4E2A;&#x6570;&#x636E;&#x6210;&#x5458;&#xFF08;&#x5305;&#x62EC;<code>private</code>&#xFF0C;&#x5C3D;&#x7BA1;&#x5B50;&#x7C7B;&#x4E0D;&#x4E00;&#x5B9A;&#x90FD;&#x80FD;&#x8BBF;&#x95EE;&#xFF09;</li>
<li>&#x57FA;&#x7C7B;&#x4E2D;&#x7684;&#x6BCF;&#x4E2A;&#x666E;&#x901A;&#x6210;&#x5458;&#x51FD;&#x6570;&#xFF08;&#x5C3D;&#x7BA1;&#x5B50;&#x7C7B;&#x4E0D;&#x4E00;&#x5B9A;&#x90FD;&#x80FD;&#x8BBF;&#x95EE;&#xFF09;</li>
<li>&#x4E0E;&#x57FA;&#x7C7B;&#x76F8;&#x540C;&#x7684;&#x521D;&#x59CB;&#x6570;&#x636E;&#x5C42;</li>
<li>&#x5BF9;&#x4E8E;<code>static</code>&#x7C7B;&#x578B;&#x6210;&#x5458;&#x7684;&#x8BBF;&#x95EE;&#x6743;&#xFF08;<code>private</code>&#x9664;&#x5916;&#xFF09;</li>
</ul>
<p><strong>&#x5B50;&#x7C7B;&#x4E0D;&#x4F1A;&#x7EE7;&#x627F;&#x7684;&#x57FA;&#x7C7B;&#x7684;&#x6570;&#x636E;</strong></p>
<ul>
<li>&#x57FA;&#x7C7B;&#x7684;&#x300C;&#x6784;&#x9020;&#x51FD;&#x6570;&#x300D;&#x4E0E;&#x300C;&#x6790;&#x6784;&#x51FD;&#x6570;&#x300D;</li>
<li>&#x57FA;&#x7C7B;&#x7684;&#x53CB;&#x5143;</li>
</ul>
</blockquote>
<h2 id="32-&#x5B50;&#x5BF9;&#x8C61;&#x7684;&#x4E00;&#x751F;"><a name="32-&#x5B50;&#x5BF9;&#x8C61;&#x7684;&#x4E00;&#x751F;" class="anchor-navigation-ex-anchor" href="#32-&#x5B50;&#x5BF9;&#x8C61;&#x7684;&#x4E00;&#x751F;"><i class="fa fa-link" aria-hidden="true"></i></a>3.2. &#x5B50;&#x5BF9;&#x8C61;&#x7684;&#x4E00;&#x751F;</h2>
<blockquote>
<p>[!tip]
<strong>&#x5B50;&#x7C7B;&#x5BF9;&#x8C61;&#x521B;&#x5EFA;</strong></p>
<ol>
<li>&#x5728;&#x6808;&#x6216;&#x8005;&#x5806;&#x4E0A;&#x7ED9;&#x6574;&#x4E2A;&#x5BF9;&#x8C61;&#x5206;&#x914D;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#xFF08;&#x5305;&#x62EC;&#x4ECE;&#x7236;&#x7C7B;&#x7EE7;&#x627F;&#x7684;&#x5C5E;&#x6027;&#xFF09;</li>
<li>&#x8C03;&#x7528;&#x57FA;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6765;&#x521D;&#x59CB;&#x5316;&#x4ECE;&#x57FA;&#x7C7B;&#x7EE7;&#x627F;&#x4E0B;&#x6765;&#x7684;&#x6570;&#x636E;</li>
<li>&#x8C03;&#x7528;&#x5B50;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;&#x6765;&#x521D;&#x59CB;&#x5316;&#x5B50;&#x7C7B;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x6210;&#x5458;</li>
<li>&#x6B64;&#x65F6;&#xFF0C;&#x5B50;&#x7C7B;&#x5BF9;&#x8C61;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4E86;</li>
</ol>
<p><strong>&#x5B50;&#x7C7B;&#x5BF9;&#x8C61;&#x9500;&#x6BC1;</strong></p>
<ul>
<li>&#x9996;&#x5148;&#x8C03;&#x7528;&#x5B50;&#x7C7B;&#x7684;&#x6790;&#x6784;&#x51FD;&#x6570;</li>
<li>&#x7136;&#x540E;&#x8C03;&#x7528;&#x57FA;&#x7C7B;&#x7684;&#x6790;&#x6784;&#x51FD;&#x6570;</li>
<li>&#x6700;&#x540E;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x5185;&#x5B58;&#x8D44;&#x6E90;&#x88AB;&#x56DE;&#x6536;</li>
</ul>
</blockquote>
<sec data-title="&#x521B;&#x5EFA;&#x9500;&#x6BC1;&#x6D4B;&#x8BD5;" data-id="createDelete" data-show="true" data-collapse="true"><div class="panel panel-default"><div class="panel-heading"><b>&#x521B;&#x5EFA;&#x9500;&#x6BC1;&#x6D4B;&#x8BD5;<a class="pull-right section atTitle btn btn-default" target="createDelete"><span class="fa fa-angle-up"></span></a></b></div><div class="panel-collapse in" id="createDelete"><div class="panel-body">
<pre class="language-"><code class="lang-cpp"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;iostream&gt;</span></span>

<span class="token keyword">using</span> <span class="token keyword">namespace</span> std<span class="token punctuation">;</span>

<span class="token keyword">class</span> <span class="token class-name">Parent</span><span class="token punctuation">{</span>
<span class="token keyword">public</span><span class="token operator">:</span>
    <span class="token function">Parent</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        cout <span class="token operator">&lt;&lt;</span> <span class="token string">&quot;parent create&quot;</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token operator">~</span><span class="token function">Parent</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        cout <span class="token operator">&lt;&lt;</span> <span class="token string">&quot;parent delete&quot;</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">class</span> <span class="token class-name">Son</span><span class="token operator">:</span> <span class="token base-clause"><span class="token keyword">public</span> <span class="token class-name">Parent</span></span><span class="token punctuation">{</span>
<span class="token keyword">public</span><span class="token operator">:</span>
    <span class="token function">Son</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        cout <span class="token operator">&lt;&lt;</span> <span class="token string">&quot;son create&quot;</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token operator">~</span><span class="token function">Son</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        cout <span class="token operator">&lt;&lt;</span> <span class="token string">&quot;son delete&quot;</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>


<span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token keyword">const</span> <span class="token operator">*</span>argv<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    Son son<span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p></p><div class="terminull">
    <div class="terminullMenu">
      <div class="terminullButtons terminullClose"></div>
      <div class="terminullButtons terminullMinimize"></div>
      <div class="terminullButtons terminullZoom"></div>
    </div>
    <div class="terminullScreen">
        
          <span class="terminullDirectory">triangle@LEARN_FUCK:~</span>$ 
          <span class="terminullCommand">./a.out</span>
          
          <i class="fa fa-clone t-copy terminullCopyBtn" onclick="copyCommandTerminull(`./a.out`)"></i>
          <span class="terminullOutput">parent create
son create
son delete
parent delete</span>
        
    </div>
</div><p></p>
</div></div></div></sec>
<h2 id="33-&#x62D2;&#x7EDD;&#x7EE7;&#x627F;"><a name="33-&#x62D2;&#x7EDD;&#x7EE7;&#x627F;" class="anchor-navigation-ex-anchor" href="#33-&#x62D2;&#x7EDD;&#x7EE7;&#x627F;"><i class="fa fa-link" aria-hidden="true"></i></a>3.3. &#x62D2;&#x7EDD;&#x7EE7;&#x627F;</h2>
<p><span style="font-size:24px;font-weight:bold" class="section2">&#x5B9A;&#x4E49;<code>final</code>&#x7C7B;</span></p>
<pre class="language-"><code class="lang-cpp"><span class="token keyword">class</span> <span class="token class-name">Parent</span> <span class="token keyword">final</span><span class="token punctuation">{</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token comment">// &#x62A5;&#x9519;&#x4E0D;&#x80FD;&#x88AB;&#x7EE7;&#x627F;</span>
<span class="token keyword">class</span> <span class="token class-name">Son</span> <span class="token keyword">final</span> <span class="token operator">:</span> <span class="token keyword">public</span> Parent<span class="token punctuation">{</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token keyword">const</span> <span class="token operator">*</span>argv<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    Son son<span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p></p><div class="terminull">
    <div class="terminullMenu">
      <div class="terminullButtons terminullClose"></div>
      <div class="terminullButtons terminullMinimize"></div>
      <div class="terminullButtons terminullZoom"></div>
    </div>
    <div class="terminullScreen">
        
          <span class="terminullDirectory">triangle@LEARN_FUCK:~</span>$ 
          <span class="terminullCommand">make</span>
          
          <i class="fa fa-clone t-copy terminullCopyBtn" onclick="copyCommandTerminull(`make`)"></i>
          <span class="terminullOutput">main.cpp:8:7: error: cannot derive from &#x2018;final&#x2019; base &#x2018;Parent&#x2019; in derived type &#x2018;Son&#x2019;
 class Son final : public Parent{
       ^~~
Makefile:12: recipe for target &apos;main.o&apos; failed</span>
        
    </div>
</div><p></p>
<p><span style="font-size:24px;font-weight:bold" class="section2">&#x5B9A;&#x4E49;<code>final</code>&#x51FD;&#x6570;</span></p>
<pre class="language-"><code class="lang-cpp"><span class="token keyword">class</span> <span class="token class-name">Parent</span> <span class="token punctuation">{</span>
<span class="token keyword">public</span><span class="token operator">:</span>
   <span class="token comment">// &#x4E0D;&#x80FD;&#x88AB; override </span>
   <span class="token keyword">virtual</span> <span class="token keyword">void</span> <span class="token function">fcn</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">final</span> <span class="token punctuation">{</span>

    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">class</span> <span class="token class-name">Son</span> <span class="token keyword">final</span> <span class="token operator">:</span> <span class="token keyword">public</span> Parent<span class="token punctuation">{</span>
<span class="token keyword">public</span><span class="token operator">:</span>
    <span class="token keyword">void</span> <span class="token function">fcn</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>

    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>

<span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token keyword">const</span> <span class="token operator">*</span>argv<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    Son son<span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p></p><div class="terminull">
    <div class="terminullMenu">
      <div class="terminullButtons terminullClose"></div>
      <div class="terminullButtons terminullMinimize"></div>
      <div class="terminullButtons terminullZoom"></div>
    </div>
    <div class="terminullScreen">
        
          <span class="terminullDirectory">triangle@LEARN_FUCK:~</span>$ 
          <span class="terminullCommand">make</span>
          
          <i class="fa fa-clone t-copy terminullCopyBtn" onclick="copyCommandTerminull(`make`)"></i>
          <span class="terminullOutput">main.cpp:12:10: error: virtual function &#x2018;virtual void Son::fcn()&#x2019;
     void fcn(){
          ^~~
main.cpp:5:17: error: overriding final function &#x2018;virtual void Parent::fcn()&#x2019;
    virtual void fcn() final {
                 ^~~
Makefile:12: recipe for target &apos;main.o&apos; failed</span>
        
    </div>
</div><p></p>
<blockquote>
<p>[!note|style:flat]</p>
<ul>
<li><strong><code>final</code>&#xFF1A;&#x8BE5;&#x5173;&#x952E;&#x5B57;&#x4E3A;<code>c++11</code>&#x65B0;&#x589E;&#x7279;&#x6027;</strong></li>
<li><code>virtual &#x7C7B;&#x578B; fcn final()</code>&#xFF1A;&#x5FC5;&#x987B;&#x548C;<code>virtual</code>&#x642D;&#x914D;&#x4F7F;&#x7528;</li>
</ul>
</blockquote>
<h1 id="4-&#x91CD;&#x8F7D;&#x591A;&#x6001;"><a name="4-&#x91CD;&#x8F7D;&#x591A;&#x6001;" class="anchor-navigation-ex-anchor" href="#4-&#x91CD;&#x8F7D;&#x591A;&#x6001;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x91CD;&#x8F7D;/&#x591A;&#x6001;</h1>
<ul>
<li><strong>&#x591A;&#x6001;</strong>: <font color="#f44336">&#x7236;&#x7C7B;&#x4E0E;&#x5B50;&#x7C7B;&#x4E4B;&#x95F4;</font>&#xFF0C;&#x7236;&#x7C7B;&#x53EF;&#x4EE5;&#x63A5;&#x6536;&#x4E0D;&#x540C;&#x5B50;&#x7C7B;&#xFF0C;&#x4EA7;&#x751F;&#x4E0D;&#x540C;&#x7684;&#x884C;&#x4E3A;&#x3002;<ul>
<li><strong>virtual &#x4FEE;&#x9970;&#x51FD;&#x6570;&#x7684; override&#xFF1A;&#x7236;&#x7C7B;&#x8C03;&#x7528;&#x5B50;&#x7C7B;&#x7684;&#x5B9E;&#x73B0;&#x3002;</strong> <font color="#ff0000"> &#x8BE5;&#x65B9;&#x5F0F;&#x624D;&#x5B9E;&#x73B0;&#x591A;&#x6001;&#x3002; </font></li>
<li><strong>&#x65E0; virtual &#x4FEE;&#x9970;&#x51FD;&#x6570;&#x7684; overwrite&#xFF1A;&#x7236;&#x7C7B;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;&#x5B9E;&#x73B0;&#x3002;</strong></li>
</ul>
</li>
<li><strong>&#x91CD;&#x8F7D;</strong>: <font color="#f44336">&#x4E00;&#x4E2A;&#x7C7B;&#x91CC;</font>&#xFF0C;&#x540C;&#x4E00;&#x540D;&#x5B57;&#x7684;&#x4E0D;&#x540C;&#x65B9;&#x6CD5;&#x3002;</li>
</ul>
<h1 id="5-&#x6784;&#x9020;&#x6790;&#x6784;&#x51FD;&#x6570;"><a name="5-&#x6784;&#x9020;&#x6790;&#x6784;&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#5-&#x6784;&#x9020;&#x6790;&#x6784;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>5. &#x6784;&#x9020;/&#x6790;&#x6784;&#x51FD;&#x6570;</h1>
<ul>
<li><strong>&#x6784;&#x9020;&#x51FD;&#x6570;</strong> <ul>
<li>&#x4E0D;&#x58F0;&#x660E;&#x4E3A;&#x865A;&#x51FD;&#x6570;</li>
<li>&#x5148;&#x7236;&#x7C7B;&#xFF0C;&#x540E;&#x5B50;&#x7C7B;</li>
<li>&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x5373;&#x65E0;&#x53C2;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;</li>
</ul>
</li>
<li><strong>&#x6790;&#x6784;&#x51FD;&#x6570;</strong><ul>
<li><strong>&#x8981;&#x58F0;&#x660E;&#x4E3A;&#x865A;&#x51FD;&#x6570;; &#x901A;&#x8FC7;&#x591A;&#x6001;&#x6790;&#x6784;&#x5B50;&#x5BF9;&#x8C61;&#x65F6;&#xFF0C;&#x624D;&#x80FD;&#x6B63;&#x786E;&#x8C03;&#x7528;&#x5B50;&#x7C7B;&#x6790;&#x6784;</strong></li>
<li>&#x5148;&#x5B50;&#x7C7B;&#xFF0C;&#x518D;&#x7236;&#x7C7B;</li>
</ul>
</li>
</ul>
<h2 id="51-&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E3A;&#x5565;&#x4E0D;&#x80FD;&#x4E3A;&#x865A;&#x51FD;&#x6570;"><a name="51-&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E3A;&#x5565;&#x4E0D;&#x80FD;&#x4E3A;&#x865A;&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#51-&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E3A;&#x5565;&#x4E0D;&#x80FD;&#x4E3A;&#x865A;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>5.1. &#x6784;&#x9020;&#x51FD;&#x6570;&#x4E3A;&#x5565;&#x4E0D;&#x80FD;&#x4E3A;&#x865A;&#x51FD;&#x6570;</h2>
<ul>
<li>&#x6784;&#x9020;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5FC5;&#x987B;&#x77E5;&#x9053;&#x5BF9;&#x8C61;&#x7684;&#x5B9E;&#x9645;&#x7C7B;&#x578B;&#xFF0C;&#x800C;&#x865A;&#x51FD;&#x6570;&#x884C;&#x4E3A;&#x662F;&#x5728;&#x8FD0;&#x884C;&#x671F;&#x95F4;&#x786E;&#x5B9A;&#x5B9E;&#x9645;&#x7C7B;&#x578B;&#x7684;&#x3002;&#x5728;&#x6784;&#x9020;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x65F6;&#xFF0C;&#x7531;&#x4E8E;&#x5BF9;&#x8C61;&#x8FD8;&#x672A;&#x6784;&#x9020;&#x6210;&#x529F;&#x3002;&#x7F16;&#x8BD1;&#x5668;&#x65E0;&#x6CD5;&#x77E5;&#x9053;&#x5BF9;&#x8C61;&#x7684;&#x5B9E;&#x9645;&#x7C7B;&#x578B;</li>
<li>&#x865A;&#x51FD;&#x6570;&#x7684;&#x6267;&#x884C;&#x4F9D;&#x8D56;&#x4E8E;&#x865A;&#x51FD;&#x6570;&#x8868;&#x3002;&#x800C;&#x865A;&#x51FD;&#x6570;&#x8868;&#x5728;&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E2D;&#x8FDB;&#x884C;&#x521D;&#x59CB;&#x5316;&#x5DE5;&#x4F5C;&#xFF0C;&#x5373;&#x521D;&#x59CB;&#x5316;<code>vptr</code>&#xFF0C;&#x8BA9;&#x4ED6;&#x6307;&#x5411;&#x6B63;&#x786E;&#x7684;&#x865A;&#x51FD;&#x6570;&#x8868;&#x3002;&#x800C;&#x5728;&#x6784;&#x9020;&#x5BF9;&#x8C61;&#x671F;&#x95F4;&#xFF0C;&#x865A;&#x51FD;&#x6570;&#x8868;&#x8FD8;&#x6CA1;&#x6709;&#x88AB;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x5C06;&#x65E0;&#x6CD5;&#x8FDB;&#x884C;&#x3002;</li>
</ul>
<h1 id="6-&#x9759;&#x7ED1;&#x5B9A;&#x4E0E;&#x52A8;&#x7ED1;&#x5B9A;"><a name="6-&#x9759;&#x7ED1;&#x5B9A;&#x4E0E;&#x52A8;&#x7ED1;&#x5B9A;" class="anchor-navigation-ex-anchor" href="#6-&#x9759;&#x7ED1;&#x5B9A;&#x4E0E;&#x52A8;&#x7ED1;&#x5B9A;"><i class="fa fa-link" aria-hidden="true"></i></a>6. &#x9759;&#x7ED1;&#x5B9A;&#x4E0E;&#x52A8;&#x7ED1;&#x5B9A;</h1>
<ul>
<li><strong>&#x9759;&#x6001;&#x7C7B;&#x578B;</strong>&#xFF1A;&#x5BF9;&#x8C61;&#x5728;&#x58F0;&#x660E;&#x65F6;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x5728;&#x7F16;&#x8BD1;&#x671F;&#x65E2;&#x5DF2;&#x786E;&#x5B9A;&#xFF1B;</li>
<li><strong>&#x52A8;&#x6001;&#x7C7B;&#x578B;</strong>&#xFF1A;&#x901A;&#x5E38;&#x662F;&#x6307;&#x9488;&#x6216;&#x5F15;&#x7528;&#x6240;&#x6307;&#x5BF9;&#x8C61;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x662F;&#x5728;&#x8FD0;&#x884C;&#x671F;&#x51B3;&#x5B9A;&#x7684;&#xFF1B;</li>
</ul>
<pre class="language-"><code class="lang-cpp"><span class="token comment">/*
    * A &#x7C7B;&#x662F;&#x58F0;&#x660E;&#xFF0C;&#x662F;obj&#x7684;&#x9759;&#x6001;&#x7C7B;&#x578B;
    * B &#x7C7B;&#x662F;&#x5177;&#x4F53;&#x5B9E;&#x4F8B;&#xFF0C;&#x662F;obj&#x7684;&#x52A8;&#x6001;&#x7C7B;&#x578B;
    */</span>
    A<span class="token operator">*</span> obj <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token function">B</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<ul>
<li><strong>&#x9759;&#x6001;&#x7ED1;&#x5B9A;</strong>&#xFF1A;&#x7ED1;&#x5B9A;&#x7684;&#x662F;&#x9759;&#x6001;&#x7C7B;&#x578B;&#xFF0C;&#x6240;&#x5BF9;&#x5E94;&#x7684;&#x51FD;&#x6570;&#x6216;&#x5C5E;&#x6027;&#x4F9D;&#x8D56;&#x4E8E;&#x5BF9;&#x8C61;&#x7684;&#x9759;&#x6001;&#x7C7B;&#x578B;&#xFF0C;&#x53D1;&#x751F;&#x5728;&#x7F16;&#x8BD1;&#x671F;&#xFF1B;</li>
<li><strong>&#x52A8;&#x6001;&#x7ED1;&#x5B9A;</strong>&#xFF1A;&#x7ED1;&#x5B9A;&#x7684;&#x662F;&#x52A8;&#x6001;&#x7C7B;&#x578B;&#xFF0C;&#x6240;&#x5BF9;&#x5E94;&#x7684;&#x51FD;&#x6570;&#x6216;&#x5C5E;&#x6027;&#x4F9D;&#x8D56;&#x4E8E;&#x5BF9;&#x8C61;&#x7684;&#x52A8;&#x6001;&#x7C7B;&#x578B;&#xFF0C;&#x53D1;&#x751F;&#x5728;&#x8FD0;&#x884C;&#x671F;&#xFF1B;<font color="#f44336">&#x53EF;&#x4EE5;&#x8FDB;&#x884C;&#x4E8C;&#x6B21;&#x4FEE;&#x6539;&#x3002;</font></li>
</ul>
<pre class="language-"><code class="lang-cpp">A<span class="token operator">*</span> obj <span class="token operator">=</span> <span class="token constant">NULL</span><span class="token punctuation">;</span>
obj<span class="token operator">-&gt;</span><span class="token function">fcn</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>&#x2003;&#x2003;<font color="#f44336">&#x4E0A;&#x9762;&#x7684;&#x51FD;&#x6570;&#x4E5F;&#x662F;&#x80FD;&#x6B63;&#x5E38;&#x8FD0;&#x884C;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;obj&#x5728;&#x7F16;&#x8BD1;&#x65F6;&#x9759;&#x7ED1;&#x5B9A;&#x3002;</font></p>
<h1 id="7-&#x6784;&#x9020;&#x51FD;&#x6570;"><a name="7-&#x6784;&#x9020;&#x51FD;&#x6570;" class="anchor-navigation-ex-anchor" href="#7-&#x6784;&#x9020;&#x51FD;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>7. &#x6784;&#x9020;&#x51FD;&#x6570;</h1>
<ul>
<li><strong>&#x666E;&#x901A;&#x6784;&#x9020;&#x51FD;&#x6570;</strong>: &#x4E0D;&#x80FD;&#x4EE5;&#x672C;&#x7C7B;&#x7684;&#x5BF9;&#x8C61;&#x4F5C;&#x4E3A;<strong>&#x552F;&#x4E00;&#x53C2;&#x6570;</strong></li>
<li><strong>&#x9ED8;&#x8BA4;&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x51FD;&#x6570;</strong>: &#x5BF9;&#x6E90;&#x5BF9;&#x8C61;&#x7684;&#x9010;&#x4E2A;&#x5B57;&#x8282;&#x7684;&#x590D;&#x5236;&#xFF0C;&#x6210;&#x5458;&#x53D8;&#x91CF;&#x548C;&#x6E90;&#x5BF9;&#x8C61;&#x76F8;&#x540C;&#xFF0C;&#x7531;&#x7F16;&#x8BD1;&#x5668;&#x81EA;&#x52A8;&#x751F;&#x6210;</li>
<li><strong>&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x51FD;&#x6570;</strong>&#xFF1A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x4E00;&#x79CD;&#xFF0C;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x672C;&#x7C7B;&#x7684;&#x5F15;&#x7528;&#x7684;&#x53C2;&#x6570;&#xFF0C;&#x7528;&#x4E0D;&#x7528;const&#x4FEE;&#x9970;&#x90FD;&#x4E00;&#x6837;&#x3002;</li>
<li><strong>&#x8C03;&#x7528;&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x4E0D;&#x8C03;&#x7528;&#x666E;&#x901A;&#x6784;&#x9020;</strong>:<ul>
<li>&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x53BB;&#x521D;&#x59CB;&#x5316;&#x540C;&#x7C7B;&#x7684;&#x53E6;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;<font color="#f44336">&#x8D4B;&#x503C;&#x4E0D;&#x4F1A;&#x89E6;&#x53D1;&#x3002;</font><pre class="language-"><code class="lang-cpp">  A a<span class="token punctuation">;</span>
  <span class="token comment">// &#x521D;&#x59CB;&#x5316;</span>
  A b <span class="token operator">=</span> a<span class="token punctuation">;</span>
  A <span class="token function">c</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token comment">// &#x8D4B;&#x503C;</span>
  b <span class="token operator">=</span> a<span class="token punctuation">;</span>
</code></pre>
</li>
<li>&#x4F5C;&#x4E3A;&#x5F62;&#x53C2;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x662F;&#x7528;&#x590D;&#x5236;&#x6784;&#x9020;&#x51FD;&#x6570;&#x521D;&#x59CB;&#x5316;&#x7684;&#x3002;<font color="#f44336">&#x76F4;&#x63A5;&#x4F20;&#x9012;&#x5BF9;&#x8C61;&#xFF0C;&#x4F20;&#x8FC7;&#x53BB;&#x7684;&#x503C;&#xFF0C;&#x53D6;&#x51B3;&#x4E8E;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x5B9E;&#x73B0;&#x3002;</font></li>
<li><code>return</code> &#x8BED;&#x53E5;&#x6240;&#x8FD4;&#x56DE;&#x7684;&#x5BF9;&#x8C61;</li>
</ul>
</li>
</ul>
<blockquote>
<p>[!note|style:flat]
<strong>&#x300C;&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x51FD;&#x6570;&#x300D;&#x4E0D;&#x4EC5;&#x4F1A;&#x8986;&#x76D6;&#x6389;&#x300C;&#x9ED8;&#x8BA4;&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x51FD;&#x6570;&#x300D;&#xFF0C;&#x8FD8;&#x4F1A;&#x8986;&#x76D6;&#x6389;&#x300C;&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x51FD;&#x6570;&#x300D;</strong></p>
</blockquote>
<h1 id="8-&#x52A8;&#x591A;&#x6001;&#x4E0E;&#x9759;&#x591A;&#x6001;"><a name="8-&#x52A8;&#x591A;&#x6001;&#x4E0E;&#x9759;&#x591A;&#x6001;" class="anchor-navigation-ex-anchor" href="#8-&#x52A8;&#x591A;&#x6001;&#x4E0E;&#x9759;&#x591A;&#x6001;"><i class="fa fa-link" aria-hidden="true"></i></a>8. &#x52A8;&#x591A;&#x6001;&#x4E0E;&#x9759;&#x591A;&#x6001;</h1>
<table>
<thead>
<tr>
<th>&#x7C7B;&#x578B;</th>
<th>&#x5B9E;&#x73B0;&#x65B9;&#x5F0F;</th>
<th>&#x786E;&#x5B9A;&#x65F6;&#x95F4;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x52A8;&#x591A;&#x6001;</td>
<td>&#x7EE7;&#x627F;&#x4E0E;<code>override</code></td>
<td>&#x8FD0;&#x884C;&#x65F6;</td>
</tr>
<tr>
<td>&#x9759;&#x591A;&#x6001;</td>
<td>&#x6CDB;&#x578B;</td>
<td>&#x7F16;&#x8BD1;</td>
</tr>
</tbody>
</table>
<h1 id="9-&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x4E0E;&#x8D4B;&#x503C;"><a name="9-&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x4E0E;&#x8D4B;&#x503C;" class="anchor-navigation-ex-anchor" href="#9-&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x4E0E;&#x8D4B;&#x503C;"><i class="fa fa-link" aria-hidden="true"></i></a>9. &#x62F7;&#x8D1D;&#x6784;&#x9020;&#x4E0E;&#x8D4B;&#x503C;</h1>
<ul>
<li><strong>&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x51FD;&#x6570;</strong><ul>
<li>&#x4E00;&#x79CD;&#x7279;&#x6B8A;&#x7684;&#x6784;&#x9020;&#x51FD;&#x6570;</li>
<li>&#x590D;&#x5236;&#x7684;&#x5BF9;&#x8C61;&#x8FD8;&#x4E0D;&#x5B58;&#x5728;&#xFF0C;&#x6B63;&#x5728;&#x4E3A;&#x5BF9;&#x8C61;&#x521D;&#x59CB;&#x5316;&#x4E00;&#x5757;&#x5185;&#x5B58;&#x533A;&#x57DF;&#xFF0C;&#x5229;&#x7528;&#x590D;&#x5236;&#x503C;&#x8FDB;&#x884C;&#x521D;&#x59CB;&#x5316;&#x3002;</li>
</ul>
</li>
<li><strong>&#x8D4B;&#x503C;</strong><ul>
<li>&#x4E00;&#x79CD;&#x51FD;&#x6570;&#x64CD;&#x4F5C;</li>
<li>&#x8D4B;&#x503C;&#x7684;&#x5BF9;&#x8C61;&#x5DF2;&#x7ECF;&#x5B58;&#x5728;&#xFF0C;&#x7528;&#x590D;&#x5236;&#x503C;&#x6765;&#x8986;&#x76D6;&#x539F;&#x6765;&#x7684;&#x503C;&#x3002;</li>
</ul>
</li>
</ul>
<blockquote>
<p>[!note|style:flat]
<span style="color:red;font-weight:bold"> &#x9ED8;&#x8BA4;&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x4E0E;&#x9ED8;&#x8BA4;&#x8D4B;&#x503C;&#xFF0C;&#x5747;&#x662F;&#x539F;&#x5C01;&#x4E0D;&#x52A8;&#x7684;&#x62F7;&#x8D1D;&#x76EE;&#x6807;&#x5BF9;&#x8C61;&#x7684;&#x503C;&#xFF1B;&#x5BF9;&#x4E8E;&#x6307;&#x9488;&#x4E5F;&#x662F;&#x76F4;&#x63A5;&#x62F7;&#x8D1D;&#x6307;&#x9488;&#x7684;&#x5730;&#x5740;&#x5185;&#x5BB9;&#xFF0C;&#x4F1A;&#x9020;&#x6210;&#x9690;&#x60A3;&#x3002; </span></p>
</blockquote>
<ul>
<li><strong>&#x6B63;&#x786E;&#x7684;&#x8D4B;&#x503C;</strong><ul>
<li><strong>&#x68C0;&#x67E5;&#x662F;&#x5426;&#x4E3A;&#x540C;&#x4E00;&#x4E2A;</strong></li>
<li>&#x6307;&#x9488;&#x5185;&#x5B58;&#x662F;&#x5426;&#x8981;&#x91CA;&#x653E;</li>
<li><strong>&#x6307;&#x9488;&#x53D8;&#x91CF;&#xFF0C;&#x5BF9;&#x6307;&#x5411;&#x503C;&#x8FDB;&#x884C;&#x62F7;&#x8D1D;</strong>&#x3002;</li>
</ul>
</li>
</ul>
<pre class="language-"><code class="lang-cpp"><span class="token comment">//&#x8D4B;&#x503C;&#x51FD;&#x6570;</span>
string <span class="token operator">&amp;</span> string<span class="token double-colon punctuation">::</span><span class="token keyword">operator</span><span class="token operator">=</span><span class="token punctuation">(</span><span class="token keyword">const</span> string<span class="token operator">&amp;</span> other<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token keyword">this</span> <span class="token operator">==</span> <span class="token operator">&amp;</span>other<span class="token punctuation">)</span> <span class="token comment">//&#x81EA;&#x6211;&#x68C0;&#x67E5;</span>
    <span class="token punctuation">{</span>
        <span class="token keyword">return</span> <span class="token operator">*</span><span class="token keyword">this</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token comment">//&#x5220;&#x9664;&#x539F;&#x6709;&#x6570;&#x636E;&#x5185;&#x5B58;</span>
    <span class="token keyword">delete</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>m_data<span class="token punctuation">;</span>
    <span class="token keyword">int</span> strlen <span class="token operator">=</span> <span class="token function">strlen</span><span class="token punctuation">(</span>other<span class="token punctuation">.</span>m_data<span class="token punctuation">)</span><span class="token punctuation">;</span>
    m_data <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token keyword">char</span><span class="token punctuation">[</span>strlen <span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token function">strcpy</span><span class="token punctuation">(</span>m_data <span class="token punctuation">,</span>other<span class="token punctuation">.</span>m_data<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">return</span> <span class="token number">8</span>this<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<blockquote>
<p>[!note|style:flat]
<strong><code>T &amp; operator=(const T &amp; other)</code> &#x8FD4;&#x56DE;&#x4E86;&#x539F;&#x5BF9;&#x8C61;&#xFF0C;&#x5219;&#x4E32;&#x884C;&#x8D4B;&#x503C;&#xFF0C;&#x662F;&#x6B63;&#x786E;&#x7684;&#x3002;</strong></p>
<pre class="language-"><code class="lang-cpp"><span class="token keyword">class</span> <span class="token class-name">Test</span><span class="token punctuation">{</span>
   <span class="token keyword">public</span><span class="token operator">:</span>
         <span class="token keyword">int</span> a<span class="token punctuation">;</span>
   <span class="token punctuation">}</span><span class="token punctuation">;</span>

   Test a1<span class="token punctuation">,</span>b1<span class="token punctuation">,</span>c1<span class="token punctuation">;</span>
   <span class="token comment">// &#x4E32;&#x884C;&#x8D4B;&#x503C;</span>
   a1 <span class="token operator">=</span> b1 <span class="token operator">=</span> c1<span class="token punctuation">;</span>
   <span class="token comment">// &#x4FEE;&#x6539;&#x8FD4;&#x56DE;&#x503C; &#x4FEE;&#x6539;&#x7684;&#x662F; a1 &#x7684;&#x503C;</span>
   <span class="token punctuation">(</span>a1 <span class="token operator">=</span> b1<span class="token punctuation">)</span><span class="token punctuation">.</span>a <span class="token operator">=</span> <span class="token number">12</span><span class="token punctuation">;</span>
</code></pre>
</blockquote>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="point_reference_withNum.html" class="navigation navigation-prev " aria-label="Previous page: 三、指针与引用">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="memory_withNum.html" class="navigation navigation-next " aria-label="Next page: 五、内存">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"四、面向对象","level":"2.1.4","depth":2,"next":{"title":"五、内存","level":"2.1.5","depth":2,"path":"cpp/chapter/memory_withNum.md","ref":"cpp/chapter/memory_withNum.md","articles":[]},"previous":{"title":"三、指针与引用","level":"2.1.3","depth":2,"path":"cpp/chapter/point_reference_withNum.md","ref":"cpp/chapter/point_reference_withNum.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-lunr","-search","search-pro-fixed","expandable-chapters-small","ancre-navigation","hide-element","code","splitter","insert-logo-link-website","-sharing","sharing-plus","prism","-highlight","flexible-alerts","lightbox","pageview-count","auto-scroll-table","katex-pro","favicon-absolute","sectionx","terminull-light","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"],"lang":{"flow":"typescript"}},"livereload":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"auto-scroll-table":{},"code":{"copyButtons":true},"terminull-light":{},"search-pro-fixed":{},"favicon-absolute":{"favicon":"image/ico.png","appleTouchIconPrecomposed152":"image/ico.png","appleTouchIconMore":{},"appleTouchIconPrecomposedMore":{}},"hide-element":{"elements":[".gitbook-link"]},"katex-pro":{},"fontsettings":{"theme":"white","family":"sans","size":2},"sectionx":{"tag":"b"},"lightbox":{"jquery":true,"sameUuid":false},"insert-logo-link-website":{"url":"image/logo.png","link":"https://space.bilibili.com/27206875","target":"_blank","style":"height: 230px"},"pageview-count":{},"ancre-navigation":{"showLevel":true,"associatedWithSummary":true,"mode":"float","printLog":false,"multipleH1":true,"float":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""},"pageTop":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""}},"expandable-chapters-small":{},"flexible-alerts":{"style":"callout","note":{"label":"Note","icon":"fa fa-info-circle","className":"info"},"tip":{"label":"Tip","icon":"fa fa-lightbulb-o","className":"tip"},"warning":{"label":"Warning","icon":"fa fa-exclamation-triangle","className":"warning"},"danger":{"label":"Attention","icon":"fa fa-ban","className":"danger"}},"sharing":{"qq":true,"all":["douban","facebook","google","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","whatsapp"],"douban":false,"facebook":false,"weibo":true,"whatsapp":false,"twitter":false,"pocket":false,"google":true,"qzone":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"海拉尔的三角","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"计算机笔记","links":{"sidebar":{"Github":"https://github.com/spite-triangle"}},"gitbook":"*"},"file":{"path":"cpp/chapter/oop_withNum.md","mtime":"2021-09-14T15:43:12.739Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-09-14T15:43:23.052Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro-fixed/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro-fixed/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-insert-logo-link-website/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-auto-scroll-table/plugin.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-terminull-light/terminull.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

